<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<table border="2" cellspacing="0" width="850" cellpadding="10px" bgcolor="#fffafa">
	<tr bgcolor="lightblue">
		<td width="75">
			번호 : ${requestScope.show_content.no}
		</td>
		<td width="450">
		&nbsp;	제목 : ${requestScope.show_content.title}
		</td>
		<td>
			작성자 : 
			<c:choose>
				<c:when test="${requestScope.show_content.boardMemberId!=null }">
					${requestScope.show_content.boardMemberId}
				</c:when>
				<c:when test="${requestScope.show_content.companyMemberId!=null }">
					${requestScope.show_content.companyMemberId}
				</c:when>
				<c:when test="${requestScope.show_content.adminMemberId!=null }">
					${requestScope.show_content.adminMemberId}
				</c:when>
				<c:otherwise>
					손님
				</c:otherwise>			
			</c:choose>
		</td>
		<td>
		조회수 : ${requestScope.show_content.viewcount}
		</td>
	</tr>
	<tr>
			<td colspan="4">
			<c:if test="${not empty requestScope.show_content.pictureName}">
				<img width="850" src="/${initParam.context_root }/upfile/${requestScope.show_content.pictureName}"/><br>
			</c:if>
			${requestScope.show_content.content}
		</td>
	</tr>
</table>
<a href="/${initParam.context_root}/selectBoardByPage.do?page=${param.page}&contentGroup=${param.contentGroup}"><button>글 목록</button></a>
<a href="/${initParam.context_root }/boardReplyForm.do?no=${requestScope.show_content.no}&page=${param.page}"><button>답글</button></a>
<c:if test="${sessionScope.adminDTO.id!=null}">
	<a href="/${initParam.context_root }/boardModify.do?no=${requestScope.show_content.no}&page=${param.page}"><button>수정</button></a>
	<a href="/${initParam.context_root }/boardDelete.do?no=${requestScope.show_content.no}&contentGroup=2&page=${param.page}"><button>삭제</button></a>
</c:if>

<c:if test="${sessionScope.memberDTO.id!=null}">
	<c:if test="${requestScope.show_content.boardMemberId eq sessionScope.memberDTO.id }">
		<a href="/${initParam.context_root }/boardModify.do?no=${requestScope.show_content.no}&page=${param.page}"><button>수정</button></a>
		<a href="/${initParam.context_root }/boardDelete.do?no=${requestScope.show_content.no}&contentGroup=2&page=${param.page}"><button>삭제</button></a>
	</c:if>
</c:if>

<c:if test="${sessionScope.companyDTO.id!=null}">
	<c:if test="${requestScope.show_content.companyMemberId eq sessionScope.companyDTO.id }">
		<a href="/${initParam.context_root }/boardModify.do?no=${requestScope.show_content.no}&page=${param.page}"><button>수정</button></a>
		<a href="/${initParam.context_root }/boardDelete.do?no=${requestScope.show_content.no}&contentGroup=2&page=${param.page}"><button>삭제</button></a>
	</c:if>
</c:if>
</body>
</html>